#include <stdio.h>


float Convert(unsigned char a,unsigned char b,unsigned char c,unsigned char d)
{
    unsigned char x_int[] = {a,b,c,d};
    float *p = (float*)x_int;
    return *p;
}

int HexValue(char one)
{
		if(one == '1')
		{
			return 1;
		}
		else if(one == '2')
		{
			return 2;
		}
		else if(one == '3')
		{
			return 3;
		}
		else if(one == '4')
		{
			return 4;
		}
		else if(one == '5')
		{
			return 5;
		}
		else if(one == '6')
		{
			return 6;
		}
		else if(one == '7')
		{
			return 7;
		}
		else if(one == '8')
		{
			return 8;
		}
		else if(one == '9')
		{
			return 9;
		}
		else if(one == '0')
		{
			return 0;
		}
		else if(one == 'A')
		{
			return 10;
		}
		else if(one == 'B')
		{
			return 11;
		}
		else if(one == 'C')
		{
			return 12;
		}
		else if(one == 'D')
		{
			return 13;
		}
		else if(one == 'E')
		{
			return 14;
		}
		else if(one == 'F')
		{
			return 15;
		}
		
		return -1;
}

int main()
{
    printf("run \n");

    unsigned char pMem[] = {0x66,0xE6,0xF0,0x42};  
    float *p = (float*)pMem;  
    printf("%g\r\n",*p);  

    

    unsigned char x[] = {0xE5,0xD2,0x6A,0x72};
    float *p_x = (float*)x;  
    printf("%g\r\n",*p_x);

    float result = Convert(229,210,106,114);
    printf("%g\r\n",result);

    unsigned char x_int[] = {229,210,106,114};
    float *p_x_int = (float*)x_int;  
    printf("%g\r\n",*p_x_int);

//0100 | 0010 | 1110 | 1101 | 0000 | 0000 | 0000
    unsigned char book[] = {0x66,0xE6,0xF0,0x00};  
    float *p_book = (float*)book;  
    printf("%g\r\n",*p_book);  

    return 0;
}

